﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ent;
namespace DAL
{
    public class DiemDAL:clsKetNoi
    {
        dataDataContext dt;
        public void Luu(DiemTbl diem)
        {
            dt = GetKetnoi();
            DIEM d = dt.DIEMs.Where(n => n.MADETHI == diem.MaDeThi).Where(j => j.MSSV == diem.MSSV).Single();
            d.DIEM1 = diem.Diem;
            dt.SubmitChanges();
        }
        public bool SoMonHoc(string masv)
        {
            dt = GetKetnoi();
            IEnumerable<DIEM> d = dt.DIEMs.Where(j => j.MSSV == masv);
            foreach (DIEM item in d)
            {
                if(item.MSSV == masv)
                    return true;
            }
            return false;
        }
    }
}
